package IOPerations;

import Books.BooksList;

import java.util.Scanner;

public class AlsoOperations implements IOperations{
    @Override
    public void work(BooksList booksList) {
        System.out.println("归还书籍");
        System.out.println("请输入你想要归还的书籍");

        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();

        int tmp = booksList.getVal();

        for (int i = 0; i < tmp; i++) {
            if (booksList.getBook(i).getName().equals(name)){
                booksList.getBook(i).setBorrow(false);
                return;
            }
        }
        System.out.println("没有找到你要归还的这本书");

    }
}
